package com.learning.controller;

import com.learning.model.UserDO;
import com.learning.service.user.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("/index")
    public String index(Model model){
        UserDO userDO = userService.findUserByUsername("xjt");
        model.addAttribute("user",userDO);
        return "user/user";
    }
}
